﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using QingzimaDB;

namespace QingzimaLogicModel
{
    public class DingdanLM : JichuLM
    {
        #region 属性区
        /// <summary>
        /// 订单号
        /// </summary>
        public string DingdanHao { get; set; }
        /// <summary>
        /// 产品KEY
        /// </summary>
        public string ChanpinKey { get; set; }
        /// <summary>
        /// 产品名称
        /// </summary>
        public string ChanpinMingcheng { get; set; }
        /// <summary>
        /// 价格
        /// </summary>       
        public Decimal ChanpinJiage { get; set; }
        /// <summary>
        /// 数量
        /// </summary>       
        public int ChanpinShuliang { get; set; }
        /// <summary>
        /// 地址
        /// </summary>       
        public string Dizhi { get; set; }
        /// <summary>
        /// 用户KEY
        /// </summary>       
        public string YonghuKey { get; set; }
        /// <summary>
        ///送水员KEY
        /// </summary>       
        public string SongShuiYuanKey { get; set; }
        /// <summary>
        /// 订单状态
        /// </summary>       
        public string ZhuangTai { get; set; }
        /// <summary>
        /// 是否删除
        /// </summary>       
        public int IsDel { get; set; }
        #endregion

        #region 构造区
        public DingdanLM()
        {

        }

        public DingdanLM(DingdanDB dbModel)
        {
            ID = dbModel.ID;
            Key = dbModel.Key;
            CreatedTime = dbModel.CreatedTime;
            ChanpinKey = dbModel.ChanpinKey;
            ChanpinMingcheng = dbModel.ChanpinMingcheng;
            ChanpinJiage = dbModel.ChanpinJiage;
            ChanpinShuliang = dbModel.ChanpinShuliang;
            Dizhi = dbModel.Dizhi;
            YonghuKey = dbModel.YonghuKey;
            SongShuiYuanKey = dbModel.SongShuiYuanKey;
            ZhuangTai = dbModel.ZhuangTai;
            IsDel = dbModel.IsDel;
            DingdanHao = dbModel.DingdanHao;

        }
        #endregion

        #region 方法区
        public void Save()
        {
            DingdanDB dbModel = new DingdanDB();
            dbModel.ID = ID;
            dbModel.Key = Key;
            dbModel.CreatedTime = CreatedTime;
            dbModel.ChanpinKey = ChanpinKey;
            dbModel.ChanpinJiage = ChanpinJiage;
            dbModel.ChanpinShuliang = ChanpinShuliang;
            dbModel.ChanpinMingcheng = ChanpinMingcheng;
            dbModel.Dizhi = Dizhi;
            dbModel.DingdanHao = DingdanHao;
            dbModel.YonghuKey = YonghuKey;
            dbModel.SongShuiYuanKey = SongShuiYuanKey;
            dbModel.ZhuangTai = ZhuangTai;
            dbModel.IsDel = IsDel;
            dbModel.Save();
        }
        #endregion
    }
}
